<template>
  <div class="code-wrap">
      <div class="code-content">
          <div class="avatar"><img :src="avatar?avatar:'https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=3987166397,2421475227&fm=27&gp=0.jpg'" alt=""></div>
          <div class="name">{{name}}</div>
          <div class="profession">{{title?title:''}}</div>
          <div class="code-img"><img :src="infoObj.images[0].fileUrl" alt=""></div>
          <div class="code-tip">
              <p>扫一扫或点击右上角的按纽</p>
              <p>转发可与患者建立长期联系</p>
          </div>
      </div>
  </div>
</template>

<script>
let CONSTANT = require('../../../wechat/static/constant/constant.js'),
    common = require("../../../wechat/static/common/common.js"),
    wsService = require("../../../wechat/static/common/wechat-jsdk.js");
export default {
  components: {
  },
  data () {
    return {
        infoObj:'',
        title:'',
        name:'',
        avatar:''
    }
  },
  mounted(){
     this.getInfo();
     this.name = this.$router.currentRoute.query.name;
     this.title = this.$router.currentRoute.query.title;
     this.avatar = this.$router.currentRoute.query.avatar
  },
  methods:{
    getInfo(){
        let  url = CONSTANT.URL.DOCTOR.GETQRCODE,
            param = {}
        common.requestAjax(url,{},param,(res)=>{
            if(res.status == 200){
                let data = res.data.bussData;
                this.infoObj = data;
                console.log(data)
            }else{

            }
        })
    },
  }
}
</script>

<style lang="scss">
 .code-wrap{
     height: 100%;
     overflow: hidden;
     background-color: #0063AE;
     .code-content{
         position: relative;
         text-align: center;
         width: 6.6rem;
         height: 7.8rem;
         background-color: #fff;
         border-radius: 4px;
         -webkit-border-radius: 4px;
         margin: 1.62rem auto 0;
         font-size: .34rem;
         color: #333;
         padding-top: 1rem;
         .avatar{
             position: absolute;
             width: 1.61rem;
             height: 1.61rem;
             left: 2.62rem;
             top: -.81rem;
             img{
                 width: 1.61rem;
                 height: 1.61rem;
                 border-radius: 50%;
                 -webkit-border-radius: 50%;
             }
         }
         .name{
             font-size:.34rem;
             color: #333;
         }
         .profession{
            font-size:.3rem;  
         }
         .code-img{
             margin-top: .3rem;
             img{
                 width: 4.93rem;
                 height: 4.93rem;
             }
         }
         .code-tip{
             margin-top: .3rem;
             font-size: .24rem;
             color: #999999;
         }
     }
 }
</style>
